﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Admin_User.aspx.cs" Inherits="Backend_Admin_User" %>

<%@ Import Namespace="Wsitech.Model" %>
<%@ Import Namespace="Wsitech.BLL" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>用户管理</title>
    <link href="!css/content.css" rel="stylesheet" type="text/css" />
    <script src="!js/jquery-1.7.1.js" type="text/javascript"></script>
    <script src="!js/default.js" type="text/javascript"></script>
    <!--colorbox-->
    <link href="../!js/colorbox/colorbox.css" rel="stylesheet" type="text/css" />
    <script src="../!js/colorbox/jquery.colorbox-min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            $('.colorbox').colorbox({ iframe: true, width: 400, height: 300 });
        });
    </script>
    <!--colorbox-->
</head>
<body>
    <form id="form1" runat="server">
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
            <td class="bgleft" valign="top">
                <img src="/Backend/images/left-top-right.gif" />
            </td>
            <td class="bgcenter" valign="top">
                <div class="title">
                    用户管理
                </div>
            </td>
            <td class="bgright" width="16" valign="top">
                <img src="/Backend/images/nav-right-bg.gif" />
            </td>
        </tr>
        <tr class="main">
            <td class="bgleft" valign="middle">
                &nbsp;
            </td>
            <td valign="top">
                <!--Content-->
                <div class="content">
                    <div>
                        <div class="list_title">
                            用户列表
                            <p class="add_news">
                                <a class="colorbox" href="Admin_UserAdd.aspx">添加新用户</a>
                            </p>
                        </div>
                        <table width="100%" border="0" cellspacing="1" cellpadding="0" class="list_table">
                            <tr>
                                <th>
                                    用户名
                                </th>
                                <th>
                                    角色
                                </th>
                                <th>
                                    添加时间
                                </th>
                                <th>
                                    状态
                                </th>
                                <th>
                                    编辑
                                </th>
                            </tr>
                            <asp:Repeater ID="repMain" runat="server" OnItemCommand="repMain_ItemCommand" OnItemDataBound="repMain_ItemDataBound">
                                <ItemTemplate>
                                    <tr>
                                        <td>
                                            <%#(Container.DataItem as AdminUser).UserName%>
                                        </td>
                                        <td>
                                            <%#string.Join(",",AdminRoleBLL.Instance.GetRoleListByUserId((Container.DataItem as AdminUser).UserID).Select(r=>r.RoleName))%>
                                        </td>
                                        <td>
                                            <%#(Container.DataItem as AdminUser).CreateDate.ToString("yyyy-MM-dd")%>
                                        </td>
                                        <td>
                                            <asp:LinkButton ID="lbtnEnable" CommandName="Enable" CommandArgument="<%#(Container.DataItem as AdminUser).UserID%>"
                                                runat="server" class="red"><img src="/Backend/images/disabled.gif" title="点击设为启用" /></asp:LinkButton>
                                            <asp:LinkButton ID="lbtnDisable" CommandName="Disable" CommandArgument="<%#(Container.DataItem as AdminUser).UserID%>"
                                                runat="server" class="blue"><img src="/Backend/images/enabled.gif" title="点击设为禁用" /></asp:LinkButton>
                                        </td>
                                        <td>
                                            <a class="colorbox" href="Admin_UserAdd.aspx?uid=<%#(Container.DataItem as AdminUser).UserID%>">
                                                <img src="images/edit.gif" title="编辑" />
                                            </a>
                                        </td>
                                    </tr>
                                </ItemTemplate>
                            </asp:Repeater>
                        </table>
                    </div>
                </div>
                <!--Content-->
            </td>
            <td class="bgright">
                &nbsp;
            </td>
        </tr>
        <tr>
            <td class="bg_bottom_left" valign="bottom">
                &nbsp;
            </td>
            <td class="bg_bottom_center">
            </td>
            <td class="bg_bottom_right" valign="bottom">
            </td>
        </tr>
    </table>
    </form>
</body>
</html>
